unit SmallStruct.Configuration;

interface

uses Classes,
  Types,
  SmallStruct.Core;

const
  SS_CONFIGURATION_LOADER = 'SS_CONFIGURATION_LOADER';

type
  TSSViewFieldType = (ssvftTextEdit = 1, ssvftNumericEdit = 2, ssvftDateEdit = 3, ssvftTimeEdit = 3, ssvftMemoEdit = 4, ssvftCheckBoxEdit = 6,
    sfvftDBTextEdit = 7, ssvftDBListEdit = 8, ssvftDBNumericEdit = 9, ssvftDBDateEdit = 10, ssvftDBTimeEdit = 11,
    ssvftDBMemoEdit = 12, ssvftDBCheckBoxEdit = 13, ssvftChartLable = 14, ssvftChartValue = 15);

  ISSViewFieldConfiguration = interface(ISSConfiguration)
    ['{6AFC3925-A003-4FEF-BBDE-B44E510DFC66}']
    function GetFieldName: string;
    function GetCol: Integer;
    function GetHeight: Integer;
    function GetLinkFieldName: string;
    function GetLinkModelName: string;
    function GetLinkKeyFieldName: string;
    function GetRow: Integer;
    function GetType: TSSViewFieldType;
    function GetWidth: Integer;
    function IsVisiable: Boolean;
  end;

  TSSViewType = (ssvtCustomizeView = 1, ssvtDataGridView = 2, ssvtDataFormView = 3, ssvtMultiView = 4, ssvtDynamicDataFormView = 5,
    ssvtBarChartView = 6, ssvtPieChartView = 7, ssvtFastLineChartView = 8, ssvtPointChartView = 9);

  ISSViewConfiguration = interface(ISSConfiguration)
    ['{DEE9F1AE-8511-4AFB-A123-45A79DCEC0F3}']
    function GetViewName: string;
    function GetModelName: TStrings;
    function GetFieldConfiguration: ISSObjectContainer;
    function GetInnerViewName: TStrings;
    function GetPrimaryModelName: string;
    function GetType: TSSViewType;
    function IsMultiDataChoose: Boolean;
    function IsReadOnly: Boolean;
  end;

  ISSModelFieldConfiguration = interface(ISSConfiguration)
    ['{609E0E2F-2770-4A61-B5D2-0030EA26F6E1}']
    function GetFieldCaption: string;
    function GetFieldName: string;
    function IsPrimaryKey: Boolean;
    function IsReadOnly: Boolean;
    function IsRequired: Boolean;
  end;

  TSSModelType = (ssmtDataModel = 1, ssmtDynamicModel = 2);

  ISSModelConfiguration = interface(ISSConfiguration)
    ['{C27B3328-4711-4C9D-9A5A-ADA4F3C9D452}']
    function GetModelName: string;
    function GetDatabaseConnectionName: string;
    function GetEntityName: string;
    function GetFieldConfiguration: ISSObjectContainer;
    function GetOpenCondition: string;
    function GetType: TSSModelType;
    function IsAutoOpen: Boolean;
    function IsReadOnly: Boolean;
  end;

  ISSBusinessObjectConfiguration = interface(ISSConfiguration)
    ['{BBE8D9AD-1F60-49E5-93CC-F221E82E54EC}']
    function GetBusinessObjectName: string;
    function GetDatabaseConnectionName: string;
    function GetReferenceBusinessObjectName: TStrings;
    function IsRequireDatabase: Boolean;
    function IsBaseScript: Boolean;
  end;

  ISSActionViewActionConfiguration = interface(ISSConfiguration)
    ['{B7D7DEDA-9156-41EC-868A-905BDD822351}']
    function GetActionName: string;
    function GetActionCaption: string;
    function GetActionFilterName: TStrings;
    function GetActionCatalog: string;
    function GetRequestActionViewName: string;
    function IsAutoClose: Boolean;
    function IsDisplay: Boolean;
  end;

  TSSActionViewType = (ssavtPage = 1, ssavtDialog = 2);

  ISSActionViewConfiguration = interface(ISSConfiguration)
    ['{69D665BE-75F5-402F-A674-D34BE963CC4A}']
    function GetActionViewName: string;
    function GetActionViewCaption: string;
    function GetActionConfiguration: ISSObjectContainer;
    function GetType: TSSActionViewType;
    function GetViewName: string;
  end;

  ISSActionConfiguration = interface(ISSConfiguration)
    ['{9AF88C04-537A-4332-9A4F-439C812D90BC}']
    function GetActionName: string;
    function GetBusinessObjectName: TStrings;
  end;

  ISSDatabaseConnectionConfiguration = interface(ISSConfiguration)
    ['{C3298C45-8114-4BBE-87F6-1A8367E01B99}']
    function GetConnectionName: string;
    function GetConnectionString: TStringList;
    function GetDriverClassName: string;
    procedure SetConnection;
  end;

  ISSConfigurationTable = interface(ISSObject)
    ['{F3A21B5C-830B-4DCE-B8FE-8F3BD942D09C}']
    function QueryActionConfiguration(const AActionName: string): ISSConfiguration;
    function QueryActionViewConfiguration(const AActionViewName: string): ISSConfiguration;
    function QueryBusinessObjectConfiguration(const ABusinessObjectName: string): ISSConfiguration;
    function QueryDatabaseConnectionConfiguration: ISSObjectContainer; overload;
    function QueryDatabaseConnectionConfiguration(const ADatabaseConnectionName: string): ISSConfiguration; overload;
    function QueryModelConfiguration(const AModelName: string): ISSConfiguration;
    function QueryViewConfiguration(const AViewName: string): ISSConfiguration;
  end;

  ISSConfigurationLoader = interface(ISSObject)
    ['{5060F305-328D-4CEB-9253-79AE5E0B0DB2}']
    function LoadActionConfiguration(const AActionName: string): ISSConfiguration;
    function LoadActionViewConfiguration(const AActionViewName: string): ISSConfiguration;
    function LoadBusinessObjectConfiguration(const ABusinessObjectName: string): ISSConfiguration;
    function LoadDatabaseConnectionConfiguration: ISSObjectContainer; overload;
    function LoadDatabaseConnectionConfiguration(const ADatabaseConnectionName: string): ISSConfiguration; overload;
    function LoadModelConfiguration(const AModelName: string): ISSConfiguration;
    function LoadViewConfiguration(const AViewName: string): ISSConfiguration;
    function LoadViewExtendConfiguration(const AViewName, AViewExtendName: string): ISSConfiguration;
  end;

  TSSSortOrder = (sssoASC = 1, sssoDESC = 2);

  TSSAggregateType = (ssatNone = 0, ssatCount = 1, ssatSum = 2, ssatAverage = 3, ssatMax = 4, ssatMin = 5);

  ISSViewExtendConfiguration = interface(ISSConfiguration)
    ['{36E75147-AD01-4AF3-81BB-200F01A0CCFE}']
    function GetFieldConfiguration: ISSObjectContainer;
  end;

  ISSViewExtendFieldConfiguration = interface(ISSConfiguration)
    ['{17124821-FEEE-42DA-94F5-850C8993090B}']
    function IsAggregateGroup: Boolean;
    function GetAggregateType: TSSAggregateType;
    function GetDisplayOrder: Integer;
    function GetFieldName: string;
    function GetGroupOrder: Integer;
    function GetSortOrder: TSSSortOrder;
    function IsDisplay: Boolean;
    function IsGroup: Boolean;
  end;

implementation

end.
